﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using SharingCenter.Web.Classes;
using SharingCenter.Web.Classes.Groups;
using SharingCenter.Web.Classes.Albums;

namespace SharingCenter.Web.Mod.Groups.Albums
{
    public partial class ViewImage : GroupsPageBase
    {
        protected Sc_Group group;
        protected AlbumsWithCoverImage album;

        protected void Page_Init(object sender, EventArgs e)
        {
            ParseGroupIdFromQueryString();
            HasRights(groupId, Profile.UserId);
            ViewAlbumImage1.AlbumImageRetrieved += new EventHandler<SharingCenter.Web.Shared.AlbumImageRetrievedEventArgs>(ViewAlbumImage1_AlbumImageRetrieved);
            
        }

        void ViewAlbumImage1_AlbumImageRetrieved(object sender, SharingCenter.Web.Shared.AlbumImageRetrievedEventArgs e)
        {
            album = e.AlbumItem;
            ltrTitle.Text = e.AlbumItem.Title;
        }

        protected void Page_Load(object sender, EventArgs e)
        {
            groupAvatar.GroupId = groupId;
            //imageId = new Guid(Request.QueryString["imgid"]);
            //ViewAlbumImage1.ImageId = imageId;
            ViewAlbumImage1.AlbumId = new Guid(Request.QueryString["aid"]);
            ViewAlbumImage1.CurrentImageIndex = Convert.ToInt32(Request.QueryString["pg"]);
            group = GroupOperations.GetGroupByGroupId(groupId);
            
            //groupAvatar.GroupId = group.GroupId;
        }
    }
}
